from TDhelper.document.ini.fields import FieldType
from TDhelper.document.ini.model import model

class CFG(model):
    
    # RPC CONFIG
    RPC_CONFIG_URI=FieldType(str,"RPC.uri")
    RPC_CONFIG_TOKEN=FieldType(str,"RPC.token")
    RPC_REGIST_TYPE= FieldType(int,"RPC.regist_type")
    
    # SERVICE CONFIG
    SERVICE_HOST=FieldType(str,"SERVICE.host")
    SERVICE_NAME= FieldType(str,"SERVICE.name")
    SERVICE_KEY= FieldType(str,"SERVICE.key")
    SERVICE_ACCESS_SECRET= FieldType(str,"SERVICE.secret")
    SERVICE_PROTOCOL= FieldType(str,"SERVICE.protocol")
    SERVICE_DESCRIPTION= FieldType(str,"SERVICE.description")
    APP_ID= FieldType(str,"SERVICE.app_id")
    APP_SECRET= FieldType(str,"SERVICE.app_secret")
    
    # DB CONFIG
    DB_HOST= FieldType(str,"DB.host")
    DB_PORT=FieldType(int,"DB.port")
    DB_NAME= FieldType(str,"DB.name")
    DB_USER= FieldType(str,"DB.user")
    DB_PASSWORD= FieldType(str,"DB.password")
    DB_ENGINE= FieldType(str,"DB.engine")
    
    # DEFAULT CONFIG
    LANGUAGE_CODE= FieldType(str,"DEFAULT.language")
    TIME_ZONE=FieldType(str,"DEFAULT.timeZone")
    ALLOWED_HOSTS= FieldType(str,"DEFAULT.allowedHosts")
    DEBUG=FieldType(bool,"DEFAULT.debug")
    CODING=FieldType(str,"DEFAULT.coding")
    TOKEN_EXPIRE_TIME=FieldType(int,"DEFAULT.expire_time")
    
    # SERVICE KEY CONFIG
    SERVICE_RPC= FieldType(str,"SERVICE_KEY.rpc")
    SERVICE_CONFIG= FieldType(str,"SERVICE_KEY.config")
    SERVICE_PERMISSION=FieldType(str,"SERVICE_KEY.permission")
    SERVICE_EVENT=FieldType(str,"SERVICE_KEY.event")
    SERVICE_API_ROUTER= FieldType(str,"SERVICE_KEY.api_router")
    SERVICE_GENERAL_SERVICE=FieldType(str,"SERVICE_KEY.general")
    SERVICE_DEVELOPER_SERVICE=FieldType(str,"SERVICE_KEY.developer")
    
    # LOAD REMOTE SERVICES LIST
    LOAD_REMOTE_SERVIERS= FieldType(list, "LOAD_SERVICE.services")
    
    # CACHE MONGODB CONF
    CACHE_ENGINE=FieldType(str,"CACHE.engine")
    CACHE_HOST=FieldType(str,"CACHE.host")
    CACHE_DB= FieldType(str,"CACHE.db")
    CACHE_USER= FieldType(str,"CACHE.user")
    CACHE_PASSWD= FieldType(str,"CACHE.passwd")
    
    # INSPECTION
    INSPECTION_CONF_PATH= FieldType(str, "INSPECTION.path")
    
    # EVENT
    EVENT_CONF_PATH= FieldType(str,"EVENT.path")